<?php
include ('../../configs/cms.php');
include ('../includes/index.php');
include ('../includes/404.php');
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
	if ($_SESSION['which'] == 'choose1')
	{
		$_GET ['id'] = $_POST ['nieuwsbrief'];
		include ('../../public/layouts/cyberweekend/nieuwsbrief/index.php');
	}
}
else
{
?>
	<div style="margin-left: 40px;"><form method="POST" action="">
	Welke nieuwsbrief wilt u zien:<br />
	<?php
	$_SESSION['which'] = 'choose1';
	$query = mysql_query ("SELECT `nieuwsbrief_id`, `title` FROM `nieuwsbrief`;");
	echo '<select name="nieuwsbrief">';
	while ($result = mysql_fetch_assoc ($query))
	{
		echo '<option value="' . $result['nieuwsbrief_id'] . '">' . $result['title'] . '</option>' . "\n";
	}
	echo '</select>';
	?>
	<br /><br />
	<input type="submit" value="Laat voorbeeld zien">&nbsp;&nbsp;<input type="reset" value="Leeg formulier"></form></div>
<?php
}